package com.huas.mapper;

import com.huas.dto.RoleMenuListDTO;
import com.huas.entity.Menu;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MenuMapper {
    //获取权限关键字列表集合
    List<String> selectPermission(Integer id);

    //获取所有权限集合
    @Select("select id, menu_name, status, visible, permission, pid, sort from menu")
    List<Menu> selectMenuList();
    //删除原有数据
    @Delete("delete from role_menu where role_id = #{roleId}")
    void delete(Integer roleId);
    //插入现有数据
    void insert(RoleMenuListDTO roleMenuListDTO);

}
